<template>
  <div>
      <!-- <v-button v-for="item in arr" :key="item.id" @click="$router.push('/list?id=' + item.id)">{{item.catename}}

      </v-button> -->
    

    <van-tabs @click="onclick">
  <van-tab v-for="item in arr"
      :key="item.id" :title="item.catename"></van-tab>
  
</van-tabs>
  </div>
</template>

<script>
// import axios from 'axios'
import { reqhomecate } from '../../../http/http'
export default {
    data(){
        return{
            arr:[],
        }
    },
    mounted() {
       reqhomecate().then((res)=>{
            this.arr = res.data.list
        })
    },  
    methods:{
    onclick(index){
   
      this.$router.push("/list?id="+this.arr[index].id)
    }
  }

}
</script>

<style>

</style>